package com.ruoyi.system.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.service.SysCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:报表分析统计
 * Author: ZLZ
 * Date: 2025/4/2
 */
@RestController
@RequestMapping("/count")
public class SysCountController {
    @Autowired
    private SysCountService sysCountService;

    /**
     * 资产分类统计
     * @return
     */
    @RequiresPermissions("system:count:category")
    @GetMapping("/category")
    public AjaxResult categoryCount(){
        return AjaxResult.success(sysCountService.countCategory());
    }

    @RequiresPermissions("system:count:status")
    @GetMapping("/status")
    public AjaxResult statusCount(){
        return AjaxResult.success(sysCountService.countStatus());
    }

    @RequiresPermissions("system:count:borrow")
    @GetMapping("/borrow")
    public AjaxResult borrowCount(){
        return AjaxResult.success(sysCountService.countBorrow());
    }
}
